package com.xbongbong.saas.domain.dao;/*/*/

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.ContractProductEntity;
import com.xbongbong.saas.domain.entity.WorkOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/12 9:55
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderDao {

    Integer insert(WorkOrderEntity entity);

    Integer update(WorkOrderEntity entity);

    /**
     * 更新下更新时间
     * @param updateTime
     * @param id
     * @param corpid
     * @return
     */
    Integer updateTime(@Param("updateTime") Long updateTime, @Param("id") Long id, @Param("corpid") String corpid);

    List<WorkOrderEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    WorkOrderEntity getByKey(@Param("key") Long key,@Param("corpid") String corpid);

    /**
     * Description:批量删除
     * @param deleteIdIn
     * @param corpid
     * @return java.lang.Integer
     * @author 魏荣杰
     * @date 2019/5/9 10:54
     * @since v1.0
     */
    Integer deleteBatch(@Param("list") List<Long> deleteIdIn, @Param("corpid") String corpid);

    /**
     * Description: 批量编辑
     * @param updateList
     * @param corpid
     * @return java.lang.Integer
     * @author 魏荣杰
     * @date 2019/5/9 19:20
     * @since v1.0
     */
    Integer updateBatch(@Param("list") List<UpdateDataEntity> updateList, @Param("corpid") String corpid);

    /**
     * 批量更新
     *
     * @param workOrderList 数据列表
     * @param corpid        公司id
     * @return 影响的数据条数
     */
    Integer updateBatchList(@Param("list") List<WorkOrderEntity> workOrderList, @Param("corpid") String corpid);

    /**
     * 单个删除
     * @param key
     * @param corpid
     * @return
     */
    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<WorkOrderEntity> findNullArrayData(@Param("corpid") String corpid);
}
